package br.com.news.database.daos;

import java.util.List;

import javax.inject.Named;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import br.com.news.database.daos.interfaces.IContatoDao;
import br.com.news.database.entities.ContatoEntity;
import br.com.news.database.utils.GenericDao;

@Named
public class ContatoDao extends GenericDao<ContatoEntity, Long> implements IContatoDao{

	@Override
	public List<ContatoEntity> buscaContatosNaoEnviados() {
		Criteria criteria = getSession().createCriteria(ContatoEntity.class);
		criteria.add(Restrictions.eq("flagEnvioEmail", false));
		return criteria.list();
	}
	
}